import request from '@/utils/request'
import qs from 'qs'

export function getGradList(data) {
    return request({
      url: '/admin/gradDirectionList', // 假地址 自行替换
      method: 'get',
      params:data
    })
  }
  
export function addGradDirection(data){
    return request({
        url:'/admin/gradDirection',
        method: 'put',
        transformRequest: [
            function (data) {
                //在请求之前对data传参进行格式转换
                data = qs.stringify(data);
                return data;
            }
        ],
        data,
        headers:{
            'Content-Type':'application/x-www-form-urlencoded'
        }
    })
}

export function excelGradDirection(data){
    return request({
        url:'/admin/gradDirectionExcel',
        method: 'put',
        transformRequest: [
            function (data) {
                //在请求之前对data传参进行格式转换
                data = qs.stringify(data);
                return data;
            }
        ],
        data,
        headers:{
            'Content-Type':'application/x-www-form-urlencoded'
        }
    })
}

export function editGradDirection(data){
    return request({
        url:'/admin/gradDirection',
        method: 'post',
        transformRequest: [
            function (data) {
                //在请求之前对data传参进行格式转换
                data = qs.stringify(data);
                return data;
            }
        ],
        data,
        headers:{
            'Content-Type':'application/x-www-form-urlencoded'
        }
    })
}

export function deleteGradDirection(data){
    return request({
        url:'/admin/gradDirection',
        method: 'delete',
        params:data
    })
}

export function searchGradDirection(data){
    return request({
        url:'/admin/gradDirection',
        method: 'get',
        params:data
    })
}

export function getYears(data){
    return request({
        url:'/grad/yearList',
        method: 'get',
    })
}

export function getChange(){
    return request({
        url:'/grad/employedRate',
        method: 'get',
    })
}